<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTravelActivityTable extends Migration
{
    
    /**
     * Run the migrations.
     *
     * @return void 
     */
    public function up()
    {
        Schema::create('travel_activity', function (Blueprint $table) {
            $table->increments('id')->comment("主键");
            $table->integer('viewid')->comment("景点外键");   
            $table->float('money',8, 2)->comment("报名费用");   
            $table->string('venue',255)->comment("集合地点");   
            $table->integer('guide_tel')->comment("导游联系方式");   
            $table->integer('stop_time')->comment("截止时间");   
            $table->integer('maxnum')->comment("最大报名人数"); 
            // 设置外键
            $table->foreign('viewid')->references('id')->on('travel_view')->onDelete('cascade')->onUpdate('cascade');
            // 时间戳
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('travel_activity');
    }
}
